﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Mvc;

namespace BPMS.Web.Extends.Attributes
{
    public class JsonContentAttribute : ActionFilterAttribute
    {
        public override void OnResultExecuted(ResultExecutedContext filterContext)
        {
            string contentType = filterContext.HttpContext.Response.ContentType;
            if ("application/json".Equals(contentType, StringComparison.OrdinalIgnoreCase))
                filterContext.HttpContext.Response.ContentType = "text/plain";
            base.OnResultExecuted(filterContext);
        }
    }
}
